﻿    <%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Admin.Master"
    Inherits="System.Web.Mvc.ViewPage<WebHoiChoMuaBan.Models.Member>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
	AddAdmin
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <script type="text/javascript">
        var lastFocus = null;
        var lastValue = -1;
        var arrValue = new Array("Tên đăng nhập", "Mật khẩu", "Nhập lại mật khẩu", "Họ tên", "Email", "Số di động");
        function UpdateTextbox(obj) {
            if (lastFocus != null && lastFocus.value == "" && lastValue != -1) {
                lastFocus.value = arrValue[lastValue];
            }
            lastFocus = obj;

            switch (obj.value) {
                case arrValue[0]: lastValue = 0; obj.value = ""; break;
                case arrValue[1]: lastValue = 1; obj.value = ""; break;
                case arrValue[2]: lastValue = 2; obj.value = ""; break;
                case arrValue[3]: lastValue = 3; obj.value = ""; break;
                case arrValue[4]: lastValue = 4; obj.value = ""; break;
                case arrValue[5]: lastValue = 5; obj.value = ""; break;
            }
        }
    </script>

    <form method="post" action="<%=Url.Action("AddAdmin", "AdminManagement") %>" enctype="multipart/form-data">
    <div class="col_left hoicho_marin_leftright content_right">
        <div class="content_group">
            <div class="col_left content_group hoicho_margin_topbottom">
                <p class="font_bold">Tạo mới admin</p>
            </div>
            <div class="col_right"><%=Html.ActionLink("Danh sách admin","Index",null,new { @class="hoicho_bt_submit_reg" }) %></div>
          <%--  <div class="col_right"><a href="#" class="hoicho_bt_submit_reg hoicho_margin_right">Phân quyền</a></div>--%>
            <div class="clear"></div>
        </div>
        <div class="error">
            <%=Html.ValidationSummary("Vui lòng nhập đầy đủ thông tin.") %>
        </div>
        <table width="100%" border="0">
            <tr>
                <td width="40%"><%= Html.TextBox("username", (Model == null ? "Tên đăng nhập" : Model.MemUsername), new { @class = "input_full", onfocus = "UpdateTextbox(this)" })%></td>
                <td width="2%"><span class="Asterisk">*</span></td>
                <td width="58%" rowspan="4"><img src="/../Content/Images/avatar_admin.png" alt="" width="100px" height="100px"/></td>
            </tr>
            <tr>
                <td width="37%"><input type="text" class="input_full" id="password" name="password" value="Mật khẩu" onfocus="UpdateTextbox(this)" /></td>
                <td width="2%"><span class="Asterisk">*</span></td>
            </tr>
            <tr>
                <td width="37%"><input type="text" class="input_full" id="conPassword" name="conPassword" value="Nhập lại mật khẩu" onfocus="UpdateTextbox(this)" /></td>
                <td width="2%"><span class="Asterisk">*</span></td>
            </tr>
            <tr>
                <td width="37%">
                    <%= Html.TextBox("fullname", (Model == null ? "Họ tên" : Model.MemFullname), new { @class = "input_full", onfocus="UpdateTextbox(this)"})%></td>
                <td width="2%"><span class="Asterisk">*</span></td>
            </tr>
            <tr>
                <td width="37%">
                    <%= Html.TextBox("email", (Model == null ? "Email" : Model.MemEmail), new { @class = "input_full", onfocus = "UpdateTextbox(this)" })%></td>
                <td width="2%"><span class="Asterisk">*</span></td>
            </tr>
            <tr>
                <td>
                    <%= Html.TextBox("cellphone", (Model == null ? "Số di động" : Model.MemCellPhone), new { @class = "input_full", onfocus = "UpdateTextbox(this)" })%>
                </td>
                <td>&nbsp;</td>
            </tr>
            <tr>
                <td><input type="file" id="photo" name="photo"/></td>
                <td>&nbsp;</td>
            </tr>
            <tr>
                <td>
                    <%= Html.DropDownList("ddlMemberType", (SelectList)ViewData["MemType"], new { style = "width:255px" })%>
                </td>
            </tr>
            <tr>
                <td >
                    <div>
                        <input type="submit" value="Hoàn tất" class="hoicho_bt_submit_reg" />
                    </div>
                </td>
            </tr>
        </table>
    </div>
    </form>
</asp:Content>

<asp:Content ID="Content3" ContentPlaceHolderID="HeadHolder" runat="server">
</asp:Content>
